package com.liang.manage.auth.facade.server;

import com.liang.manage.auth.facade.dto.role.RolePermissionsDTO;
import com.liang.manage.auth.facade.dto.role.RolePermissionsInDTO;
import com.liang.nansheng.common.auth.UserSsoDTO;

import java.util.List;

/**
 * @author 王华安
 * @date 2021-04-25 23:23
 */
public interface RolePermissionsService {
    /**
     * 根据角色id获取角色权限信息
     *
     * @param roleId
     * @return
     */
    List<RolePermissionsDTO> getByRoleId(Integer roleId);

    /**
     * 根据权限id获取角色权限信息
     *
     * @param permissionsIdId
     * @return
     */
    List<RolePermissionsDTO> getByPermissionsId(Integer permissionsIdId);

    /**
     * 根据角色id删除角色权限
     *
     * @param roleId
     * @param currentUser
     * @return
     */
    Boolean deleteByRoleId(Integer roleId, UserSsoDTO currentUser);

    /**
     * 根据权限id删除角色权限
     *
     * @param permissionsId
     * @param currentUser
     * @return
     */
    Boolean deleteByPermissionsId(Integer permissionsId, UserSsoDTO currentUser);

    /**
     * 添加权限
     *
     * @param rolePermissionsInDTO
     * @param currentUser
     * @return
     */
    Boolean addPermissions(RolePermissionsInDTO rolePermissionsInDTO, UserSsoDTO currentUser);

    /**
     * 移除权限
     *
     * @param rolePermissionsInDTO
     * @param currentUser
     * @return
     */
    Boolean removePermissions(RolePermissionsInDTO rolePermissionsInDTO, UserSsoDTO currentUser);
}
